import { FastDataAPi } from "@/api";
import React, { useEffect, useState } from "react";
import SubjectListItem from "@/views/Home/components/SubjectListItem";
import "./fast.less";
// 快速刷题页面
export default function Fast() {
  const [state, setState] = useState<IFastData>();
  useEffect(() => {
    FastDataAPi().then((res) => {
      if (res.errCode === 0) {
        setState(res.data);
      }
    });
  }, []);
  return (
    <div className="fast">
      {state?.records.map((item) => (
        <SubjectListItem
          key={item.id}
          buttonText="刷题"
          data={item}
          // isFast 是true，就是快速刷题
          isFast={true}
        />
      ))}
    </div>
  );
}
